---
title: Introduction
description: Guides and references for all you need to know about Pyrefly type checker and IDE extension.
---

import CodeSnippet from '@site/src/sandbox/CodeSnippet'

Pyrefly is a fast type checker and language server for Python with powerful IDE features. It analyzes your Python code to help you catch type-related errors before your code runs, making your applications more reliable and easier to maintain. Pyrefly supports both IDE integration and CLI usage, giving you flexibility in how you incorporate type checking into your workflow.

## Benefits of Type Checking

Adding type annotations to your Python code and using a type checker like Pyrefly provides several important benefits:

- **Catch bugs early** - Identify type-related errors during development rather than at runtime
- **Improve code quality** - Type annotations serve as living documentation, making your code more readable and self-documenting
- **Enhance developer experience** - Get better IDE support with accurate autocomplete, refactoring tools, and inline documentation
- **Safer refactoring** - Make large-scale changes with confidence, knowing the type checker will catch incompatible type usage
- **Better collaboration** - Types create clear contracts between different parts of your codebase, making it easier for teams to work together

## Try Pyrefly

Here's a simple example showing how Pyrefly can catch type errors:

<CodeSnippet
  sampleFilename="getting_started.py"
  codeSample={`# Example: Basic Type Checking

def greet(name: str) -> str:
    return "Hello, " + name

# This works fine since both "World" is a string and greet expects a string
message = greet("World")

# Pyrefly catches this error before runtime due to a type misatch between 42 and "str"
# Error: Argument of type 'int' is not assignable to parameter of type 'str'
error_message = greet(42)
`}
/>

In this example, Pyrefly flags the second call to `greet()` because we're passing an integer (`42`) where a string is expected, helping you catch this issue before your code runs. To learn more about Python typing and how to use it effectively:

- If you're new to Python, check out our [Python Typing for Beginners](python-typing-for-beginners) guide.
- If you're familiar with Python but new to typing, see our [Typing for Python Developers](typing-for-python-developers) guide.
